Skip to content

fix(mcpx): read daemon.tsnetUpTimeout instead of the built-in default - #11920

Merged
dezren39 merged 1 commit into
mainfrom
fix/mcpx-tsnet-up-timeout
Nov 18, 2026
Merged

dezren39 merged 1 commit into
mainfrom
fix/mcpx-tsnet-up-timeout

Conversation

@dezren39

@dezren39 dezren39 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Before: daemon.tsnetUpTimeout was declared and documented, but the tsnet listener and the client's tsnet dialer both read the built-in 30s default. Setting it to give a slow tailnet join more time did nothing. The settings consumption test let it through with the note "read by transport_tsnet.go without an accessor", which wasn't true.

After: the daemon's tsnet listener and the client's tsnet:// dialer both wait the configured budget, and only an unset value falls back to the default. The error on a failed join names the budget that was actually used.

How: tsnetTransport and TSNetDialer take an upTimeout, tsnetUpBudget picks it or the default, listenTSNet passes s.set.Duration("daemon.tsnetUpTimeout"), and the client passes its own setting to NewTSNetDialer. The allowance in consumed_test.go is gone, since the setting is now read through an accessor. TestTSNetUpBudgetHonoursTheSetting covers the fallback. The setting keeps its effect-probe exemption, since a real join still needs a tailnet. Found while working through #8468.


Generated by Claude Code


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

Summary by CodeRabbit

  • Bug Fixes
    • TSNet connections now honor the configured startup timeout when establishing or listening for connections. When the setting is zero or negative, the default timeout is used.
    • Timeout errors now include the applicable time limit, making connection delays easier to understand.

The tsnet listener and the client's tsnet dialer both waited
defaults.TSNetUpTimeout, so setting daemon.tsnetUpTimeout changed
nothing. The daemon now passes its setting to the listener and the
client passes it to the dialer; an unset value still falls back to the
default. Drops the consumed-test allowance that claimed the setting was
read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@dezren39
dezren39 marked this pull request as ready for review November 18, 2026 21:12
@dezren39
dezren39 requested a review from a team as a code owner November 18, 2026 21:12
@dezren39
dezren39 merged commit 25a3773 into main Nov 18, 2026
@dezren39
dezren39 deleted the fix/mcpx-tsnet-up-timeout branch November 18, 2026 21:12
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T21:13:06.368984Z aa07ab3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

TSNet listener and dialer startup now use the configured daemon.tsnetUpTimeout. Non-positive values use defaults.TSNetUpTimeout. The CLI and daemon pass the setting to their TSNet components, and tests cover timeout resolution and propagation.

Changes: TSNet Startup Timeout

Layer / File(s) Summary
Resolve and apply the TSNet timeout
pkgs/mcpx/internal/daemon/transport_tsnet.go
The transport stores a configured upTimeout. Positive values are used, while zero or negative values fall back to defaults.TSNetUpTimeout. Listener and dialer join operations use the resolved budget and include it in timeout errors.
Pass and verify the configured timeout
pkgs/mcpx/internal/cli/client.go, pkgs/mcpx/internal/daemon/server.go, pkgs/mcpx/internal/daemon/tsnet_up_budget_test.go, pkgs/mcpx/internal/settings/consumed_test.go
The CLI dialer and daemon listener receive daemon.tsnetUpTimeout. Tests cover fallback and configured values. The settings test no longer allows this setting to lack a resolved-settings accessor read.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: claude

Merge Risk: Moderate · up to aa07a

The configured TSNet join timeout is now passed to both the daemon listener and the client dialer. However, client commands against a tsnet:// endpoint still probe readiness with the short ping timeout, so a slow join can fail before the longer budget helps. The new test also would not catch a regression in the join paths themselves. Resolve these before merging.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants